# -*- coding: utf-8 -*-
from socialbar.models import Bar, Deal, Price
from socialbar.constants import DEALSSTATUS
from django.contrib.auth.models import User

MEMCACHE_COORDINATE = 'coordinate'

def boot():
    
    # Users #
    users = User.objects.all()
    users.delete()
    
    user = User.objects.create_user('joe', 'lennon@gmail.com', 'password')
    user.is_superuser = True
    user.is_staff = True
    user.save()
    
    user2 = User.objects.create_user('timmy', 'timmy@gmail.com', 'password')
    user2.is_superuser = True
    user2.is_staff = True
    user2.save()
    
    user3 = User.objects.create_user('bob', 'bob@gmail.com', 'password')
    user3.save()
    user4 = User.objects.create_user('bob2', 'bob2@gmail.com', 'password')
    user4.save()

    # Bars #
    bars = Bar.objects.all()
    bars.delete()
    
    bar = Bar()
    bar.name = "Mad Maker Pub"
    bar.longitude = "2.3418062"
    bar.latitude = "48.848244"
    bar.picturePath = "bar3.jpg"
    bar.adminLogin = user
    bar.address = "22, Rue Cujas , 75005 Paris"
    bar.description = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
    bar.save()

    bar1 = Bar()
    bar1.name = "Bombardier"
    bar1.longitude = "2.3418062"
    bar1.latitude = "48.846831"
    bar1.picturePath = "bar1.jpg"
    bar1.address = "2, Place du Panthéon , 75005 Paris"
    bar1.adminLogin = user2
    bar1.description = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
    bar1.save()

    bar2 = Bar()
    bar2.name = "Smoke"
    bar2.longitude = "2.3266135"
    bar2.latitude = "48.8415405"
    bar2.picturePath = "bar2.jpg"
    bar2.address = "29, Rue Delambre , 75014 Paris "
    bar2.description = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
    bar2.save()
    
    # Deal #
    deals = Deal.objects.all()
    deals.delete()
    
    
    Deal(user=user3, status=1, price=1).save()
    Deal(user=user3, status=1, price=1).save()
    Deal(user=user3, status=1, price=1).save()
    Deal(user=user3, status=1, price=1).save()
    Deal(user=user3, bar=bar1, status=2, price=1).save()
    Deal(user=user3, bar=bar1, status=2, price=1).save()
    Deal(user=user4, bar=bar1, status=2, price=1).save()
    Deal(user=user4, bar=bar1, status=2, price=1).save()
    Deal(user=user4, bar=bar1, status=2, price=1).save()
    
    # Prices #
    prices = Price.objects.all()
    prices.delete()
    Price(nbCoupon = 1, price = '1').save()
    Price(nbCoupon = 2, price = '2').save()
    Price(nbCoupon = 3, price = '3').save()
    Price(nbCoupon = 4, price = '4').save()
    Price(nbCoupon = 6, price = '5').save()
    Price(nbCoupon = 7, price = '6').save()
    
    
    
    